<%@ page language="java" %>
<%@ page import="java.util.Hashtable,
                 ro.gateway.aida.obj.Organization,
                 ro.gateway.aida.usr.User,
                 ro.gateway.aida.usr.UserUtils,
                 ro.gateway.aida.srv.EditorServlet,
                 ro.xblue.translator.LanguageBean,
                 ro.xblue.translator.TranslatorUtils,
                 ro.gateway.aida.obj.Person,
                 java.util.Iterator,
                 ro.gateway.aida.usr.Arbiter,
                 ro.gateway.aida.usr.Perms,
                 ro.gateway.aida.db.PersistenceToken,
                 ro.gateway.aida.db.PersistenceManager,
                 ro.gateway.aida.utils.HttpUtils
"%>

<%@ taglib uri="/WEB-INF/taglib.tld" prefix="gtw" %>
<%@ taglib uri="/WEB-INF/translator.tld" prefix="trans" %>
<%@ taglib uri="/WEB-INF/usr.tld" prefix="usr" %>


<!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
 <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> 
<title>View Organization</title>
<link rel="stylesheet" href="alf.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" class=text>
<%
Hashtable bean=EditorServlet.getBean(request);
Organization org=(Organization)bean.get("org");
LanguageBean lang_bean = TranslatorUtils.getCurrentLanguage(request, application);
String lang=lang_bean.language;
User user = UserUtils.getLogged(request,response);
String ctx = request.getContextPath();
PersistenceToken token = PersistenceManager.tokenLookup( application );
Arbiter ar=Arbiter.getManager(token);
String mode=(String)request.getAttribute("mode");
%>


<%if("list".equals(mode)) {%>
   <% pageContext.include("../header.jsp"); %>
<%}%>

<trans:initPage module="orgform" />

  <table width="98%" border="0" cellspacing="1" cellpadding="5" class="text_search" bgcolor="#3399CC" align="center">
    <tr> 
      <th colspan="2" class=textalb bgcolor="3399CC"><trans:showPageMessage label="org.view" /></th>
    </tr>
    <tr> 
      <td width="30%" bgcolor="ffffff"><trans:showPageMessage label="org.orgname" />:</td>
      <td bgcolor="#FFFFFF" class="text_searchbold"> <%=org.getName().getString(lang)%></td>
    <tr> 
      <td width="30%" bgcolor="#FFFFFF"><trans:showPageMessage label="org.abbrev" />:</td>
      <td bgcolor="#FFFFFF" class="text_searchbold"><%=(org.getAcronym()==null)?"":org.getAcronym()%></td>
    </tr>
    <%if(org.getAIDAOrg()!=null){%>
    <tr> 
      <td width="30%" bgcolor="#FFFFFF"><trans:showPageMessage label="org.aidaorg" />:</td>
      <td bgcolor="#FFFFFF" class="text_searchbold"> <%=org.getAIDAOrg()%></td>
    </tr>
    <%}%>
    <tr> 
      <td width="30%" bgcolor="#FFFFFF"><trans:showPageMessage label="org.country" />:</td>
      <td bgcolor="#FFFFFF" class="text_searchbold"><%=HttpUtils.strPrint(org.getCountryName(),"")%></td>
    </tr>
    <tr> 
      <td width="30%" bgcolor="#FFFFFF"><trans:showPageMessage label="org.desc" />:</td>
      <td bgcolor="#FFFFFF" class="text_searchbold"><%=org.getDescription().getString(lang)%></td>
    </tr>
    <tr> 
      <td width="30%" bgcolor="#FFFFFF"><trans:showPageMessage label="org.orgtype" />:</td>
      <td bgcolor="#FFFFFF" class="text_searchbold"> <%=org.getType().getName().getString(lang)%></td>
    </tr>
    <tr> 
      <td width="30%" bgcolor="#FFFFFF"><trans:showPageMessage label="org.contactname" />:</td>
      <td bgcolor="#FFFFFF" class="text_searchbold"> <%=HttpUtils.strPrint(org.getContactName(),"")%></td>
    </tr>
    
    <tr> 
      <td width="30%" bgcolor="#FFFFFF"><trans:showPageMessage label="org.contacttitle" />:</td>
      <td bgcolor="#FFFFFF" class="text_searchbold"> <%=HttpUtils.strPrint(org.getContactTitle(),"")%></td>
    </tr>
    
    <tr> 
      <td width="30%" bgcolor="#FFFFFF"><trans:showPageMessage label="org.contactemail" />:</td>
      <td bgcolor="#FFFFFF" class="text_searchbold"> <a href="mailto:<%=HttpUtils.strPrint(org.getContactEmail(),"")%>"><%=HttpUtils.strPrint(org.getContactEmail(),"")%></a></td>
    </tr>
  <tr> 
      <td width="30%" bgcolor="#FFFFFF"><trans:showPageMessage label="org.contacturl" />:</td>
      <td bgcolor="#FFFFFF" class="text_searchbold"> <a href="<%=HttpUtils.strPrint(org.getContactURL(),"")%>" target=_blank> <%=HttpUtils.strPrint(org.getContactURL(),"")%> </a></td>
    </tr>
  <tr> 
      <td width="30%" bgcolor="#FFFFFF"><trans:showPageMessage label="org.contactfax" />:</td>
      <td bgcolor="#FFFFFF" class="text_searchbold"> <%=HttpUtils.strPrint(org.getContactFax(),"")%></td>
    </tr>
  <tr> 
      <td width="30%" bgcolor="#FFFFFF"><trans:showPageMessage label="org.contactphone" />:</td>
      <td bgcolor="#FFFFFF" class="text_searchbold"> <%=HttpUtils.strPrint(org.getContactPhone(),"")%></td>
    </tr>

    <tr> 
      <td width="30%" bgcolor="#FFFFFF"><trans:showPageMessage label="org.address1" />:</td>
      <td bgcolor="#FFFFFF" class="text_searchbold"> <%=HttpUtils.strPrint(org.getAddress1(),"")%></td>
    </tr>
    <tr> 
      <td width="30%" bgcolor="#FFFFFF"><trans:showPageMessage label="org.address2" />:</td>
      <td bgcolor="#FFFFFF" class="text_searchbold"> <%=HttpUtils.strPrint(org.getAddress2(),"")%></td>
    </tr>
    <tr>
      <td width="30%" bgcolor="#FFFFFF"><trans:showPageMessage label="org.contact" />:</td>
      <td bgcolor="#FFFFFF" class="text_searchbold"><% 
Iterator ip=org.getPersons().iterator();
while (ip.hasNext()) {
	Person element = (Person) ip.next();%>
    <a href=# onclick="javascript:window.open('<%=ctx%>/pers/view?id=<%=element.getId()%>', 'pers_viewer', 'status=yes,WIDTH=400,HEIGHT=400,SCROLLBARS=yes');">
      <%=element.getName()%></a> <%if(ip.hasNext()) {%>,<%}%>
      <%}%></td>
    </tr>
    


      <tr> 
      <td width="30%" bgcolor="#FFFFFF"><trans:showPageMessage label="org.infosource" />:</td>
      <td bgcolor="#FFFFFF" class="text_searchbold"> <%=org.getInfoSource()%></td>
    </tr>  

	<%if(ar.canDo(request,Perms.EDIT_OBJECT,org.getId(),Arbiter.ORG_TYPE)) {%>
	<tr colspan="2" bgcolor="#FFFFFF">
	<td  bgcolor="#f9f9f9" class="text_searchbold">
		<a href=<%=ctx%>/org/editorg.do?orgid=<%=org.getId()%> 
<% if(!"list".equals(mode)) {%>target="_blank"<%}%>	><trans:showPageMessage label="org.editinfo" /></a>
	</td><td bgcolor="#f9f9f9">&nbsp;</td>
	</tr>
	<%}%>
    

      <tr>
      <td align="center" colspan="2" bgcolor="#FFFFFF" class="text_searchbold">
      	     <a href=# onclick="javascript:window.open('<%=ctx%>/usr/view.jsp?id=<%=org.getUserID()%>', 'user_viewer', 'status=yes,WIDTH=400,HEIGHT=200,scrollbars=YES');">    	
      	     	<trans:showPageMessage label="org.editordetails" />
      	     </a>
      </td>
    </tr>  

    
  </table><p>
<%if("list".equals(mode)) {%>
   <% pageContext.include("../footer.jsp"); %>
<%}%>

</body>
</html>